﻿@using System.Data
@using System.Data.SqlClient
@using ZoomLa.SQLDAL
@using ZoomLa.Common
@model ZoomLa.SQLDAL.SQL.PageSetting
@{
    Model.url = "SearchList";
}
@functions{
    protected string getanswer(string id)
    {
        SqlParameter[] sp = new SqlParameter[] { new SqlParameter("id", id) };
        string answer;
        DataTable dt = Sql.Sel("ZL_GuestAnswer", " QueId=@id", "", sp);
        if (dt.Rows.Count > 0)
        {
            answer = (dt.Rows[0]["Content"]).ToString();
            return answer;
        }
        else
            return " ";
    }
    protected string gettype(string id)
    {
        SqlParameter[] sp = new SqlParameter[] { new SqlParameter("id", id) };
        DataTable dt = Sql.Sel("zl_grade", " GradeID=@id", "", sp);
        if (dt.Rows.Count > 0)
        {
            string name;
            name = (dt.Rows[0]["GradeName"]).ToString();
            return name;

        }
        else
            return " ";
    }
}
<div id="EGV">
    @if (Model.itemCount > 0)
    {
        foreach (DataRow dr in Model.dt.Rows)
        {
            <table>
                <tr>
                    <td>
                        <h3>
                            <a target="_self" href="SearchDetails?ID=@dr["ID"]"> @dr["Qcontent"]</a>
                        </h3>
                        <div class="abstract">@getanswer(dr["ID"].ToString())</div>
                        <div class="fs">
                            @MvcHtmlString.Create(dr["IsNi"].ToString() == "1" ? "匿名" : "<a href='/ShowList?id=" + dr["UserID"] + "' target='_blank'>" + dr["UserName"] + "</a>")
                            - @DataConverter.CDate(dr["AddTime"]).ToString("yyyy-MM-dd")--<a href="#">@gettype(dr["QueType"].ToString())</a>
                        </div>
                    </td>
                </tr>
            </table>
        }
        <div class="text-center">
            @Html.Partial("_page2", Model)
        </div>
    }

</div>